#ifndef SMATERHOME_H
#define SMATERHOME_H

#include <QWidget>
#include "head.h"
namespace Ui {
class SmaterHome;
}

class SmaterHome : public QWidget
{
    Q_OBJECT

public:
    explicit SmaterHome(QWidget *parent = nullptr);
    ~SmaterHome();

    void setButtonIcon(QPushButton *button, const QString &imagePath);
public slots:
    void slotLoadSerialPort();
    void slotCloseSerialPort();
    void slotOpenSerialPort();
    void slotReadData();
    void slotSend();

    void slotToggleButton1();   // 切换按钮1
    void slotToggleButton2();   // 切换按钮2
    void slotToggleButton3();   // 切换按钮3
    void slotToggleButton4();   // 切换按钮4
private slots:
    void on_pushButton_clicked();

private:
    Ui::SmaterHome *ui;
    QSerialPort *m_serialPort;

    // 记录每个按钮的开关状态
    bool button1State;
    bool button2State;
    bool button3State;
    bool button4State;


};

#endif // SMATERHOME_H
